object fCadastroFalecimento: TfCadastroFalecimento
  Left = 0
  Top = 0
  Caption = 'Falecimento'
  ClientHeight = 578
  ClientWidth = 503
  Color = 16776176
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = True
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object lblTitulo: TLabel
    Left = 0
    Top = 0
    Width = 503
    Height = 32
    Align = alTop
    Alignment = taCenter
    Caption = 'Cadastro de Falecimento'
    Color = 16776176
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -29
    Font.Name = 'Calisto MT'
    Font.Style = [fsBold]
    ParentColor = False
    ParentFont = False
    Transparent = False
    ExplicitWidth = 315
  end
  object gbListaAssociados: TGroupBox
    AlignWithMargins = True
    Left = 3
    Top = 35
    Width = 497
    Height = 499
    Align = alClient
    Caption = 'Lista de Associados'
    TabOrder = 0
    object cxgrdCliente: TcxGrid
      AlignWithMargins = True
      Left = 5
      Top = 18
      Width = 487
      Height = 253
      Align = alClient
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      TabOrder = 0
      object gdDependentes: TcxGridDBTableView
        NavigatorButtons.ConfirmDelete = False
        DataController.DataSource = dsDependentes
        DataController.Summary.DefaultGroupSummaryItems = <>
        DataController.Summary.FooterSummaryItems = <
          item
            Kind = skCount
            FieldName = 'cod_dependente'
          end>
        DataController.Summary.SummaryGroups = <>
        OptionsView.GroupByBox = False
        Styles.StyleSheet = DataModule1.cxStyleSheetTBVWGridTableViewStyleSheetDevExpress
        object colDependentesnome: TcxGridDBColumn
          DataBinding.FieldName = 'nome'
          Width = 307
        end
        object colDependentesdatanascimento: TcxGridDBColumn
          DataBinding.FieldName = 'datanascimento'
        end
        object colDependentescod_contrato: TcxGridDBColumn
          DataBinding.FieldName = 'cod_contrato'
        end
        object colDependentescod_cliente: TcxGridDBColumn
          DataBinding.FieldName = 'cod_cliente'
        end
        object colDependentescod_dependente: TcxGridDBColumn
          DataBinding.FieldName = 'cod_dependente'
        end
        object cxgrdbclmnDependentesdatacontrato: TcxGridDBColumn
          DataBinding.FieldName = 'data contrato'
        end
        object cxgrdbclmnDependentestemcarencia: TcxGridDBColumn
          DataBinding.FieldName = 'tem carencia'
        end
      end
      object gdLevelcxgrdlvlcliente: TcxGridLevel
        GridView = gdDependentes
      end
    end
    object gbInfoFalecimento: TGroupBox
      AlignWithMargins = True
      Left = 5
      Top = 277
      Width = 487
      Height = 113
      Align = alBottom
      Caption = 'Informa'#231#245'es de Falecimento'
      TabOrder = 1
      DesignSize = (
        487
        113)
      object lbl1: TLabel
        Left = 11
        Top = 65
        Width = 105
        Height = 13
        Caption = 'Causa do Falecimento'
      end
      object lbl2: TLabel
        Left = 11
        Top = 19
        Width = 98
        Height = 13
        Caption = 'Data de Falecimento'
      end
      object cxdteDatafalecimento: TcxDateEdit
        Left = 11
        Top = 38
        Style.LookAndFeel.NativeStyle = True
        StyleDisabled.LookAndFeel.NativeStyle = True
        StyleFocused.LookAndFeel.NativeStyle = True
        StyleHot.LookAndFeel.NativeStyle = True
        TabOrder = 0
        Width = 150
      end
      object edCausa: TEdit
        Left = 11
        Top = 84
        Width = 473
        Height = 21
        Anchors = [akLeft, akTop, akRight]
        TabOrder = 1
      end
    end
    object gbDespesaExtra: TGroupBox
      AlignWithMargins = True
      Left = 5
      Top = 396
      Width = 487
      Height = 98
      Align = alBottom
      Caption = 'Adicionar Despesa de Diferen'#231'a de Funeral'
      TabOrder = 2
      object lblValorDespesa: TLabel
        Left = 17
        Top = 32
        Width = 87
        Height = 13
        Caption = 'Valor da Despesa:'
      end
      object lblNumeroParcelas: TLabel
        Left = 247
        Top = 32
        Width = 118
        Height = 13
        Caption = 'Quantidade de Parcelas:'
      end
      object lbldiavencto: TLabel
        Left = 17
        Top = 58
        Width = 84
        Height = 26
        Caption = 'Dia do M'#234's '#13#10'para Vencimento:'
      end
      object spQtdeParcelas: TSpinEdit
        Left = 371
        Top = 29
        Width = 74
        Height = 22
        MaxValue = 48
        MinValue = 1
        TabOrder = 1
        Value = 1
      end
      object spvencto: TSpinEdit
        Left = 109
        Top = 62
        Width = 96
        Height = 22
        MaxValue = 30
        MinValue = 1
        TabOrder = 2
        Value = 1
      end
      object edtValorExtra: TEdit
        Left = 109
        Top = 29
        Width = 96
        Height = 21
        TabOrder = 0
      end
    end
  end
  object pnlbuttons: TPanel
    Left = 0
    Top = 537
    Width = 503
    Height = 41
    Align = alBottom
    TabOrder = 1
    object btnDeclaracaoObito: TBitBtn
      Left = 249
      Top = 12
      Width = 124
      Height = 25
      Caption = 'Declara'#231#227'o de '#211'bito'
      DoubleBuffered = True
      Enabled = False
      ParentDoubleBuffered = False
      TabOrder = 2
    end
    object btnConfirmar: TButton
      Left = 3
      Top = 12
      Width = 124
      Height = 25
      Caption = 'Confirmar Falecimento'
      TabOrder = 0
      OnClick = btnConfirmarClick
    end
    object btnParcelas: TBitBtn
      Left = 126
      Top = 12
      Width = 124
      Height = 25
      Caption = 'Criar Parcelas'
      DoubleBuffered = True
      ParentDoubleBuffered = False
      TabOrder = 1
      OnClick = btnParcelasClick
    end
  end
  object dsDependentes: TDataSource
    DataSet = qryDependentes
    Left = 416
    Top = 40
  end
  object seqParcelas: TZSequence
    Connection = DataModule1.Connection
    SequenceName = 'public.seqparcelasdespesas'
    Left = 264
    Top = 40
  end
  object qryDependentes: TZQuery
    Connection = DataModule1.Connection
    Active = True
    SQL.Strings = (
      'select '
      '       co.cod_contrato,'
      #9'   c.cod_cliente,'#9
      '       d.cod_dependente,'
      #9'   d.nome,'
      '       d.datanascimento,'
      '       co.data_inicio as "data contrato", '
      
        '       case when date_part('#39'day'#39',(CURRENT_DATE - co.data_inicio)' +
        ') > (p.carencia * 30) then '#39'N'#195'O'#39
      '       else '#39'SIM'#39' end as "tem carencia"'
      'from dependentes d'
      '     join clientes c on d.cod_cliente = c.cod_cliente'
      '     join contratos co on co.cod_cliente = c.cod_cliente'
      '     join planos p on co.cod_plano = p.cod_plano'
      'where'
      #9'co.status = '#39'ATIVO'#39' and d.data_falecimento is null')
    Params = <>
    Left = 328
    Top = 40
    object intgrfldDependentescod_contrato: TIntegerField
      FieldName = 'cod_contrato'
      Required = True
    end
    object intgrfldDependentescod_cliente: TIntegerField
      FieldName = 'cod_cliente'
      Required = True
    end
    object wdstrngfldDependentesnome: TWideStringField
      FieldName = 'nome'
      Size = 256
    end
    object dtmfldDependentesdatanascimento: TDateTimeField
      FieldName = 'datanascimento'
    end
    object intgrfldDependentescod_dependente: TIntegerField
      FieldName = 'cod_dependente'
      Required = True
    end
    object dtmfldDependentesdatacontrato: TDateTimeField
      FieldName = 'data contrato'
    end
    object mfldDependentestemcarencia: TMemoField
      FieldName = 'tem carencia'
      ReadOnly = True
      BlobType = ftMemo
    end
  end
end
